package com.bingbing.back.service.Impl;

import com.bingbing.back.mapper.SchoolRecruitInfoMapper;
import com.bingbing.back.po.SchoolRecruitInfo;
import com.bingbing.back.service.SchoolRecruitInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class SchoolRecruitInfoServiceImpl implements SchoolRecruitInfoService {

    @Resource
    private SchoolRecruitInfoMapper schoolRecruitInfoMapper;

    @Override
    public List<SchoolRecruitInfo> showTitle(int schoolId) {
        return schoolRecruitInfoMapper.showTitle(schoolId);
    }

    @Override
    public List<String> showContentByInfoId(int infoId) {
        List<String> list = new ArrayList<>();
        String content = schoolRecruitInfoMapper.showContentByInfoId(infoId);
        String[] result = content.split("\\\\n");
        for (int i = 0; i < result.length; i++){
            list.add(result[i]);
        }
        return list;
    }
}
